{% extends 'datacenter/base/center_base.html' %}
{% load post_filters %}

{% block head %}
    <meta name="referrer" content="none">
    <script src="{% static 'js/center_manage.min.js' %}"></script>
{% endblock %}

{% block title %}
    Post Management
{% endblock %}

{% block main %}
    <section class="content">
        <div class="container-fluid pt-4">
            {% include 'base/loading.html' %}
            <div class="row" id="content-block">

            </div>
        </div>
    </section>

    <script id="data-list" type="text/html">
    {% verbatim %}
        <div class="col-sm-12">
            <div class="card">

                <div class="card-header">
                    <div class="p-2 d-flex">
                        <p class="h3">Japan Earth <small class="text-danger" style="font-size: 15px">DataSource:{{ if data.from_cache  }}Cache{{ else }}Databse{{ /if }}</small></p>
                        <form action="" method="get" class="form-inline ml-auto">
                            <input type="text" value="{{ cur_fid }}" name="fid" hidden>
                            <div class="form-group mr-4">
                                <label for="title-input">标题：</label>
                                {{ if data.title }}
                                    <input type="text" class="form-control" name="search" id="title-input"
                                           placeholder="关键字"
                                           value="{{ data.title }}">
                                {{ else }}
                                    <input type="text" class="form-control" name="search" id="title-input"
                                           placeholder="关键字">
                                {{ /if }}
                            </div>
                            <div class="form-group mr-4">
                                <button class="btn btn-primary">查询</button>
                            </div>
                            <div class="form-group">
                                <a href="?fid={{ curblock }}">清除查询</a>
                            </div>
                        </form>
                    </div>
                </div>

                <div class="card-body">
                    <div class="row">
                        {{ each data.list_data item }}
                            <div class="row col-sm-3 pl-1 pr-1 mb-4">
                                <div class="row col-sm-12">
                                    <small>{{ item.jp_title }}</small>
                                </div>
                                <div class="row col-sm-12">
                                    <a href="{{ item.jp_url }}">{{ item.jp_location }}</a>
                                </div>
                                <div class="row col-sm-12">
                                    <small>{{ item.jp_level }}</small>
                                </div>
                                <div class="row col-sm-12">
                                    <small>{{ item.jp_max_level }}</small>
                                </div>
                                <div>
                                    {{ if item.jp_id }}
                                    <a class="btn btn-primary badge" href="{% url 'center:jpearth_send_view' jp_id=item.jp_id %}">发送详情</a>
                                    {{ /if }}
                                </div>
                            </div>
                        {{ /each }}
                    </div>

                    <div class="row">
                        <div class="col-sm-5">
                            <p class="pull-left">第{{ data.current_page }}页/总共{{ data.num_pages }}页{{ if data.from_cache }}c{{ else }}d{{ /if }}</p>
                        </div>
                        <div class="col-sm-7">
                            <div class="dataTables_paginate paging_simple_numbers float-right">
                                <ul class="pagination">

                                    {{ if data.page_obj_has_previous }}
                                        <li class="paginate_button page-item "><button class="page-link page-link-button"
                                          href="../peekpa/data/?p={{ data.page_obj_previous_page_number }}{{ data.url_query }}">上一页</button></li>
                                    {{ else }}
                                        <li class="paginate_button page-item previous disabled"><a
                                                class="page-link"
                                                href="javascript:void(0);">上一页</a>
                                        </li>
                                    {{ /if }}


                                    {{ if data.left_has_more }}
                                        <li class="paginate_button page-item "><button class="page-link page-link-button" href="../peekpa/data/?p=1">1</button>
                                        </li>
                                        <li class="paginate_button page-item "><a class="page-link"
                                                                                  href="javascript:void(0);">...</a>
                                        </li>
                                    {{ /if }}

                                    {{ each data.left_pages left_page }}

                                        <li class="paginate_button page-item "><button class="page-link page-link-button"
                                          href="../peekpa/data/?p={{ left_page }}{{ data.url_query }}">{{ left_page }}</button></li>
                                    {{ /each }}


                                    <li class="paginate_button page-item  active"><button class="page-link page-link-button"
                                         href="../peekpa/data/?p={{ data.current_page }}{{ data.url_query }}">{{ data.current_page }}</button></li>


                                    {{ each data.right_pages right_page }}
                                        <li class="paginate_button page-item "><button class="page-link page-link-button"
                                          href="../peekpa/data/?p={{ right_page }}{{ data.url_query }}">{{ right_page }}</button></li>
                                    {{ /each }}


                                    {{ if data.right_has_more }}
                                        <li class="paginate_button page-item "><a class="page-link"
                                                                                  href="javascript:void(0);">...</a>
                                        </li>
                                        <li class="paginate_button page-item "><button class="page-link page-link-button"
                                          href="../peekpa/data/?p={{ data.num_pages }}{{ data.url_query }}" >{{ data.num_pages }}</button></li>
                                    {{ /if }}


                                    {{ if data.page_obj_has_next }}
                                        <li class="paginate_button page-item next"><button class="page-link page-link-button"
                                          href="../peekpa/data/?p={{ data.page_obj_next_page_number }}{{ data.url_query }}" target="_blank">下一页</button>
                                        </li>
                                    {{ else }}
                                        <li class="paginate_button page-item next disabled"><a class="page-link"
                                                                                               href="javascript:void(0);">下一页</a>
                                        </li>
                                    {{ /if }}
                                </ul>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    {% endverbatim %}
    </script>




{% endblock %}


{#{% extends 'datacenter/base/center_base.html' %}#}
{#{% load post_filters %}#}
{##}
{#{% block head %}#}
{#    <meta name="referrer" content="none">#}
{#{% endblock %}#}
{##}
{#{% block title %}#}
{#    Post Management#}
{#{% endblock %}#}
{##}
{#{% block main %}#}
{#    <section class="content">#}
{#        <div class="container-fluid pt-4">#}
{#            <div class="row">#}
{#                <div class="col-sm-12">#}
{#                    <div class="card">#}
{##}
{#                        <div class="card-header">#}
{#                            <div class="p-2 d-flex">#}
{#                                <p class="h3">Japan Earth <small class="text-danger" style="font-size: 15px">DataSource:{% if from_cache %}Cache{% else %}Databse{% endif %}</small></p>#}
{#                                <form action="" method="get" class="form-inline ml-auto">#}
{#                                    <input type="text" value="{{ cur_fid }}" name="fid" hidden>#}
{#                                    <div class="form-group mr-4">#}
{#                                        <label for="title-input">标题：</label>#}
{#                                        {% if title %}#}
{#                                            <input type="text" class="form-control" name="search" id="title-input"#}
{#                                                   placeholder="关键字"#}
{#                                                   value="{{ title }}">#}
{#                                        {% else %}#}
{#                                            <input type="text" class="form-control" name="search" id="title-input"#}
{#                                                   placeholder="关键字">#}
{#                                        {% endif %}#}
{#                                    </div>#}
{#                                    <div class="form-group mr-4">#}
{#                                        <button class="btn btn-primary">查询</button>#}
{#                                    </div>#}
{#                                    <div class="form-group">#}
{#                                        <a href="?fid={{ curblock }}">清除查询</a>#}
{#                                    </div>#}
{#                                </form>#}
{#                            </div>#}
{#                        </div>#}
{##}
{#                        <div class="card-body">#}
{#                            <div class="row">#}
{#                                {% for item in list_data %}#}
{#                                    <div class="row col-sm-3 pl-1 pr-1 mb-4">#}
{#                                        <div class="row col-sm-12">#}
{#                                            <small>{{ item.jp_title }}</small>#}
{#                                        </div>#}
{#                                        <div class="row col-sm-12">#}
{#                                            <a href="{{ item.jp_url }}">{{ item.jp_location }}</a>#}
{#                                        </div>#}
{#                                        <div class="row col-sm-12">#}
{#                                            <small>{{ item.jp_level }}</small>#}
{#                                        </div>#}
{#                                        <div class="row col-sm-12">#}
{#                                            <small>{{ item.jp_max_level }}</small>#}
{#                                        </div>#}
{#                                        <div>#}
{#                                            {% if item.jp_id %}#}
{#                                            <a class="btn btn-primary badge" href="{% url 'center:jpearth_send_view' jp_id=item.jp_id %}">发送详情</a>#}
{#                                            {% endif %}#}
{#                                        </div>#}
{#                                    </div>#}
{#                                {% endfor %}#}
{#                            </div>#}
{##}
{#                            <div class="row">#}
{#                                <div class="col-sm-5">#}
{#                                    <p class="pull-left">第{{ current_page }}页/总共{{ num_pages }}页</p>#}
{#                                </div>#}
{#                                <div class="col-sm-7">#}
{#                                    <div class="dataTables_paginate paging_simple_numbers float-right">#}
{#                                        <ul class="pagination">#}
                                            {#上一页#}
{#                                            {% if page_obj.has_previous %}#}
{#                                                <li class="paginate_button page-item "><a class="page-link" href="?p={{ page_obj.previous_page_number }}{{ url_query }}">上一页</a></li>#}
{#                                            {% else %}#}
{#                                                <li class="paginate_button page-item previous disabled"><a#}
{#                                                        class="page-link"#}
{#                                                        href="javascript:void(0);">上一页</a>#}
{#                                                </li>#}
{#                                            {% endif %}#}
{##}
                                            {# 是否需要出现三个点 #}
{#                                            {% if left_has_more %}#}
{#                                                <li class="paginate_button page-item "><a class="page-link" href="?p=1">1</a>#}
{#                                                </li>#}
{#                                                <li class="paginate_button page-item "><a class="page-link"#}
{#                                                                                          href="javascript:void(0);">...</a>#}
{#                                                </li>#}
{#                                            {% endif %}#}
{##}
                                            {# 左边的页码 #}
{#                                            {% for left_page in left_pages %}#}
{#                                                <li class="paginate_button page-item "><a class="page-link" href="?p={{ left_page }}{{ url_query }}">{{ left_page }}</a></li>#}
{#                                            {% endfor %}#}
{##}
                                            {# 当前的页面 #}
{#                                            <li class="paginate_button page-item  active"><a class="page-link" href="?p={{ current_page }}{{ url_query }}">{{ current_page }}</a></li>#}
{##}
                                            {# 右边的页码 #}
{#                                            {% for right_page in right_pages %}#}
{#                                                <li class="paginate_button page-item "><a class="page-link" href="?p={{ right_page }}{{ url_query }}">{{ right_page }}</a></li>#}
{#                                            {% endfor %}#}
{##}
                                            {# 用来控制右边三个点 #}
{#                                            {% if right_has_more %}#}
{#                                                <li class="paginate_button page-item "><a class="page-link"#}
{#                                                                                          href="javascript:void(0);">...</a>#}
{#                                                </li>#}
{#                                                <li class="paginate_button page-item "><a class="page-link" href="?p={{ num_pages }}{{ url_query }}">{{ num_pages }}</a></li>#}
{#                                            {% endif %}#}
{##}
                                            {#下一页#}
{#                                            {% if page_obj.has_next %}#}
{#                                                <li class="paginate_button page-item next"><a class="page-link" href="?p={{ page_obj.next_page_number }}{{ url_query }}">下一页</a>#}
{#                                                </li>#}
{#                                            {% else %}#}
{#                                                <li class="paginate_button page-item next disabled"><a class="page-link"#}
{#                                                                                                       href="javascript:void(0);">下一页</a>#}
{#                                                </li>#}
{#                                            {% endif %}#}
{#                                        </ul>#}
{#                                    </div>#}
{##}
{#                                </div>#}
{#                            </div>#}
{#                        </div>#}
{#                    </div>#}
{#                </div>#}
{#            </div>#}
{#        </div>#}
{#    </section>#}
{##}
{##}
{##}
{#{% endblock %}#}
